package homework;

public class MyRectangle {
    private int longth;
    private int width;

    public MyRectangle() {
    }

    public MyRectangle(int longth, int width) {
        this.longth = longth;
        this.width = width;
    }

    public int getLongth() {
        return longth;
    }

    public void setLongth(int longth) {
        this.longth = longth;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }
    public  void getPerimeter(){
        System.out.println("该矩形周长为"+(width+longth)*2);
    }
    public void getArea(){
        System.out.println("该矩形面积为"+width*longth);
    }

}
